<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@page import="com.frame.session.UserSession"%>

<!DOCTYPE html>
<HTML>
  <head>
	<%@ include file="/platform/style.jsp"%>
	<script>
	var curcode="";
	$(function(){
		showList("");
	})
	function onselectcls(rowIndex, rowData){
		curcode=rowIndex.code;
		showList(curcode)
	}
	function showList(code){
		$w.execUrl(ctx+"/products/ProductClassPage@featuredlist.page?bean.code="+code,{},$('#infoListPanel'));
	}
	function add(){
		if(!curcode){
			window.parent.$w.infoMsg("请先选择商品类目");
			return;
		}
		if(curcode.split(".").length<3){
			window.parent.$w.infoMsg("请选择二级类目");
			return;
		}
		window.parent.$w.openDialog({title:'添加主推商品',url:ctx+"/products/ProductClassPage@featuredShow.page?bean.code="+curcode,w:900,h:480,afterClose:function(re){
			if(re){
				$w.execForm();
			}
		}});
	}
	function del(){
		window.parent.$w.confirmMsg("确定删除？", function(r){
			if(r){
				$w.doUrl(ctx+"/products/ProductClassPage@featuredDel.page",$("form").serializeArray(),function(json){
					$w.execForm();
				})
			}
		})
	}
</script>
</head>
<body class="easyui-layout">
<div data-options="region:'center',border:false">
	<div class="easyui-layout" data-options="fit:true">
		<div data-options="region:'west',split:true" title="" style="width:250px;border-right:1px solid #eee">
			<table id="selclasstree" class="easyui-treegrid"
				data-options="rownumbers:false,
				url: '<%=path %>/products/ProductClassPage@loadClassList.page?bean.code=<%=request.getParameter("rootcode")==null?"":request.getParameter("rootcode") %>',
				idField: 'id',
				fitColumns:true,
				treeField: 'name',
				onSelect:onselectcls">
				<thead>
					<tr>
						<th data-options="field:'name',width:fixWidth(1)">商品类目</th>
					</tr>
				</thead>
			</table>
		</div>
		
		<div data-options="region:'center',split:true">
			<div id="infoListPanel" class="easyui-panel" border="false" data-options="doSize:false,href:''">
			</div>
		</div>
	</div>

	</div>
  </body>
</html>